# 定义字典
score_dict = {"小李":99,"小赵":34,"小张":67,"小王":78}

# 定义空字典
my_dict1 = {}
my_dict2= dict()
print(f"成绩字典的分数为：{score_dict}，空字典1的内容为：{my_dict1}，类型为：{type(my_dict1)};空字典2的内容为：{my_dict2}，类型为：{type(my_dict2)}")

# 从字典中通过key获取value值
score_dict = {"小李":99,"小赵":34,"小张":67,"小王":78}
score_li = score_dict["小李"]
print(f"小李的成绩为：{score_li}分")
score_zhao = score_dict["小赵"]
print(f"小赵的成绩为：{score_zhao}分")

# 定义嵌套字典
stu_score_dict = {
    "小王":{
        "语文":77,
        "数学":66,
        "英语":33
    },"小周":{
        "语文":88,
        "数学":86,
        "英语":55
    },"小林":{
        "语文":99,
        "数学":96,
        "英语":66
    }
}
print(f"学生的考试信息为：{stu_score_dict}")

# 从嵌套字典获取数据
score_zhou = stu_score_dict["小周"]["数学"]
print(f"小周的数学成绩为：{score_zhou}分")

